<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
	<head>
		<meta charset="utf-8">
		<title>全站无登录修改密码</title>
		<script src="../static/js/jquery-3.3.1.min.js"></script>
		<script src="../static/js/bootstrap.min.js"></script>
		<link href="../static/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
		<style>
			.page-header h3{
				font-weight: 800;
			}
		</style>

		<script>
			$(document).ready(function () {
				$('.modifyBtn').click(function () {
					$.post(
							"${pageContext.request.contextPath}/modifyPasswordNoLogin",
							$("#modifyPasswordForm").serialize(),
							function (data) {
								if(data==0){
									alert("修改失败");
								}else{
									alert("修改成功~ 请回主页登录吧");
								}
							}
					);
				});

				$('.index').click(function () {
					var $url = "${pageContext.request.contextPath}" +'/index.jsp';
					$(window).attr('location',$url);
				});
			});
		</script>

	</head>
	<body background="../static/img/bg.png">
		<div class="contains" style="width: 50%;  margin: 200px auto;">
			<div class="check text-center"><img src="../static/img/logo.png" width="200px" /></div>

			<div class="check">
				<script>
					$('.check').show();
				</script>
				<div class="panel panel-collapse panel-primary text-center">
					<div class="page-header panel-danger">
						<h3 class="text-info">修改密码</h3>
					</div>
					<div class="panel-body text-center">
						<form class="form form-horizontal" id="modifyPasswordForm">
							<div class="form-group form-inline" style="display: none">
								<label>用户ID：<input type="text" class="form-control" name="userId" value="${sessionScope.userId}" placeholder="请输入账号" /></label>
							</div>

							<div class="form-group form-inline" style="display: none">
								<label>用户姓名：<input type="text" class="form-control" name="userName" value="${sessionScope.userName}" placeholder="请输入账号" /></label>
							</div>
							<div class="form-group form-inline" style="display: none">
								<label>用户属性：<input type="text" class="form-control" name="status" value="${sessionScope.status}" placeholder="请输入账号" /></label>
							</div>

							<div class="form-group form-inline">
								<label>用户密码：<input type="text" class="form-control" name="userPassword" placeholder="请输入要修改密码" /></label>
								<label class="tip passwordTip text-danger"></label>
							</div>
							<div class="form-group form-inline">
								<label>确认密码：<input type="text" class="form-control" placeholder="请再次输入要修改密码" /></label>
								<label class="tip confirmTip text-danger"></label>
							</div>
							<div class="form-group form-inline">
								<button class="btn btn-info  modifyBtn">确定修改</button>
								<button type="button" class="btn btn-danger index">主页</button>
								<label class="tip statusTip text-danger"></label>
							</div>
						</form>
					</div>
					<div class="panel-footer ">
						<h5>@2019-2020 JSP期末项目</h5>
					</div>

				</div>
			</div>
		</div>

	</body>
</html>
